﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Pixysoft.Framework.Reflection
{
    public interface IDummyType : IDummyMemberInfo
    {
        string Namespace { get; }

        string FullName { get; }

        IDummyAssembly Assembly { get;set;}

        /// <summary>
        /// not support Dictionary / Generic
        /// </summary>
        DotNetPropertyType PropertyType { get;set; }

        /// <summary>
        /// if propertytype = value, valid.
        /// else = UNKNOWN
        /// </summary>
        DotNetDataType DataType { get;set; }

        /// <summary>
        /// 是否数组 readonly
        /// </summary>
        bool IsArray { get;}

        /// <summary>
        /// 是否范型 readonly
        /// </summary>
        bool IsGenericType { get;}


        /// <summary>
        /// 获取数组定义 不包含Property/Attribute
        /// </summary>
        /// <returns></returns>
        IDummyType GetElementType();

        /// <summary>
        /// 获取范型定义 不包含Property/Attribute
        /// </summary>
        /// <returns></returns>
        IDummyType[] GetGenericArguments();

        /// <summary>
        /// 获取接口定义 包含property
        /// </summary>
        /// <returns></returns>
        IDummyType[] GetInterfaces();

        /// <summary>
        /// 判断是否拥有属性
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        bool HasProperty(string name);

        /// <summary>
        /// 根据名字搜索property
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        IDummyPropertyInfo GetProperty(string name);

        /// <summary>
        /// properties
        /// </summary>
        /// <returns></returns>
        IDummyPropertyInfo[] GetProperties();

        /// <summary>
        /// 根据指定输入获取方法
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        IDummyMethodInfo GetMethod(string name, IDummyType[] types);

        /// <summary>
        /// 获取所有方法
        /// </summary>
        /// <returns></returns>
        IDummyMethodInfo[] GetMethods();

        /// <summary>
        /// 不包括所有的property/value/method
        /// 指针引用拷贝:attribute/elementtype/genericargument/interface
        /// </summary>
        /// <returns></returns>
        IDummyType Clone();

        /// <summary>
        /// 验证当前type是否结构正确
        /// </summary>
        /// <returns></returns>
        bool Verify();
    }
}
